Skip to content

fix(copy): strip inline code annotations and diff markers from copied code — fixes #2222 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: feat/copy-button
Choose a base branch
from

Conversation

MohdShayan
Copy link

@MohdShayan MohdShayan commented Jun 11, 2025

This PR improves the "Copy to Clipboard" functionality for code snippets in the documentation.

Changes:

  • Removes all Shiki inline annotations such as [!code highlight], [!code diff], etc.
  • Ensures copied code is clean, readable, and production-ready.
  • Specifically addresses the feedback from @rozsazoltan and @philipp-spiess regarding comments and diff views being copied unnecessarily.

Related Issue:

Fixes tailwindlabs#2222

Let me know if any further refinements are needed!

@MohdShayan MohdShayan changed the title fix(copy): strip inline code annotations and diff markers from copied code — fixes #2224 fix(copy): strip inline code annotations and diff markers from copied code — fixes #2222 Jun 11, 2025
	modified:   src/components/code-example.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant